home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
F1 Licenseware
/
F1 Licenseware - Volume 1.iso
/
disks
/
050a.dms
/
050a.adf
/
EXAMPLE_PROGRAMS
/
example07.AMOS
/
example07.amosSourceCode
Wrap
AMOS Source Code
|
1992-02-26
|
2KB
|
68 lines
'=================
'EXAMPLE PROGRAM 7
'=================
'*****important to breakout of this program hold down CTRL and press C
'Plese note, some lines are longer than the screen width,to read these lines
'use the left cursor key on keyboard or click on arrow,bottom right of screen
Rem you should know these commands by now
'-----------------------------------------
Paper 0 : Hide : Cls 0
Rem set the variable SCORE to 0
'-------------------------------
SCORE=0
Rem This is a label a place we can tell the program to GOTO if certain
Rem conditions are met.
'----------------------------------------------------------------------
L1:
Rem Assign the variable RN a random number between 0-99
'-------------------------------------------------------
RN=Rnd(100)
Rem Another label
'----------------
L2:
Rem clear the screen
'-------------------
Cls 0
Rem Set the print position to the top left of the screen and print the score
'---------------------------------------------------------------------------
Locate 0,0 : Print "SCORE ";SCORE
Rem set the print position and get user input, hold this in the variable GUESS
'-----------------------------------------------------------------------------
Locate 0,4 : Line Input "WHAT IS YOUR GUESS? (0-99) ";GUESS
Rem If the users input(GUESS) is the same as the random number (RN) then
Rem print correct,sound the bell effect, add 1 to score, wait 2 seconds,
Rem jump to label 1.
'---------------------------------------------------------------------------
If GUESS=RN Then Locate 0,20 : Print "Correct" : Bell : Inc SCORE : Wait 100 : Goto L1
Rem if users guess is more than > random number print TOO high,sound shoot
Rem wait 2 seconds then jump (GOTO) the label called L2
'----------------------------------------------------------------------------
If GUESS>RN Then Locate 0,20 : Print "TOO HIGH" : Shoot : Wait 100 : Goto L2
Rem if guess is < (less than) RN then prompt TOO LOW,boom,wait 2 secs,goto L2
'-------------------------------------------------------------------------------
If GUESS<RN Then Locate 0,20 : Print "TOO LOW" : Boom : Wait 100 : Goto L2
Rem Amos will never reach here